﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp;
using System.Collections;
using PHMEE.Entities.MqttDt.CollectPara;

namespace PHMEE
{
    /// <summary>
    /// 策略参数
    /// </summary>
    public class SysPara : AggregateRoot<Guid>
    {
        public SysPara()
        {
        }

        public SysPara(Guid id, int spanValue)
        {
            Id = id;
            CreateTime = DateTime.UtcNow;
            LongWavePeriod = 0;
            OutType485 = 0;
            UserCustom = 4;
            CustomParams = null;
            UploadPeriod = 0;

            TechPeriod = spanValue;
            RpmPeriod = spanValue;
            RtuPeriod = spanValue;
        }

        /// <summary>
        /// 数采器类型
        /// </summary>
        public string CollectorType { get; set; }
        /// <summary>
        /// 数采器编码
        /// </summary>
        public string CollectorCode { get; set; }
        /// <summary>
        /// 在线状态
        /// </summary>
        public bool IsOnline { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 参数时间
        /// </summary>
        public DateTime? ParaTime { set; get; }
        /// <summary>
        /// 指标间隔
        /// </summary>
        public int IndexPeriod { set; get; }
        /// <summary>
        /// 工艺通道采样间隔
        /// </summary>
        public int TechPeriod { set; get; }
        /// <summary>
        /// 波形间隔
        /// </summary>
        public int WavePeriod { set; get; }
        /// <summary>
        /// 采样值间隔
        /// </summary>
        public int SamplingPeriod { set; get; }
        /// <summary>
        /// 长波形间隔（不用，默认0）
        /// </summary>
        public int LongWavePeriod { set; get; }
        /// <summary>
        /// 采集模式（1,2都代表既采集定时，也采集报警）
        /// </summary>
        public int CollectType { set; get; }
        /// <summary>
        /// 485输出类型
        /// </summary>
        public int OutType485 { set; get; }
        /// <summary>
        /// 转速间隔
        /// </summary>
        public int RpmPeriod { get; set; }
        /// <summary>
        /// Rtu间隔
        /// </summary>
        public int RtuPeriod { get; set; }
        /// <summary>
        /// 用户标记
        /// </summary>
        public int UserCustom { get; set; }
        /// <summary>
        /// 不知道干嘛，默认为null
        /// </summary>
        public int? CustomParams { get; set; }
        /// <summary>
        /// 数据上传周期（用不着，默认0）
        /// </summary>
        public int UploadPeriod { get; set; }
        /// <summary>
        /// 连续报警次数
        /// </summary>
        public int AlarmCount { get; set; }
        /// <summary>
        /// 解除报警次数
        /// </summary>
        public int UnAlarmCount { get; set; }
        /// <summary>
        /// 速度计算频率下限
        /// </summary>
        public int VelLowerFrq { get; set; }
        /// <summary>
        /// 速度计算频率上限
        /// </summary>
        public int VelUpperFrq { get; set; }
        /// <summary>
        /// 采样点数
        /// </summary>
        public int SamplingPoint { get; set; }
        /// <summary>
        /// 采样频率
        /// </summary>
        public float SamplingFrequency { get; set; }

        public ICollection<VibChannelPara> vibChannelParas { get; set; }
    }
}
